<!-- 轮播图 -->
<template>
	<view class="banner1">
		<swiper class="swiper1" :autoplay="true" :circular="true"  @change="swiper_change" :interval='3000'>
			<swiper-item v-for="(item,index) in banners" :key="index">
					<view style="color: #333;">{{item.title}}</view>
			</swiper-item>
		</swiper>
	</view>
</template>
<script>
    import mixins from '@/common/mixins.js';
	export default {
        mixins:[mixins],
		props: {
			banners: {
				type: Array,
				default: []
			},
			background: {
				type: String,
				default: '#FFFFFF'
			},
			swiperHeight: {
				type: String,
				default: '340rpx'
			},
			heightFix: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				bot_index: 0,
			};
		},
		computed: {},
		methods: {
			swiper_change(e) {
				this.bot_index = e.detail.current;
				this.$emit('botIndex',this.bot_index)
			},
		},
		mounted() {
            // #ifdef MP-ALIPAY
            this.getDom('.banner').exec((res) => {
                uni.setStorage({
                    key:'bannerDom',
                    data:res
                })
            })
            // #endif
        },
	};
</script>
<style scoped lang='scss'>
	swiper {
		height: 75rpx!important;
		line-height: 97rpx;
		width: 40%;
		margin-left: 100rpx;
	}
</style>
